package com.ruoyi.smartHighway.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
        import com.ruoyi.common.utils.DateUtils; //需要修改成自己的包名
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartHighway.mapper.NoticeReleaseMapper;
import com.ruoyi.smartHighway.domain.NoticeRelease;
import com.ruoyi.smartHighway.service.INoticeReleaseService;


/**
 * 消息通知Service业务层处理
 *
 * @author ljj
 * @date 2024-08-06
 */
@Service
public class NoticeReleaseServiceImpl extends ServiceImpl<NoticeReleaseMapper,NoticeRelease> implements INoticeReleaseService {

    @Autowired
    private NoticeReleaseMapper noticeReleaseMapper;

    /**
     * 查询消息通知
     *
     * @param noticeId 消息通知主键
     * @return 消息通知
     */
    @Override
    public NoticeRelease selectNoticeReleaseByNoticeId(Long noticeId) {
        return noticeReleaseMapper.selectNoticeReleaseByNoticeId(noticeId);
    }

    /**
     * 查询消息通知列表
     *
     * @param noticeRelease 消息通知
     * @return 消息通知
     */
    @Override
    public List<NoticeRelease> selectNoticeReleaseList(NoticeRelease noticeRelease) {
        return noticeReleaseMapper.selectNoticeReleaseList(noticeRelease);
    }

    /**
     * 新增消息通知
     *
     * @param noticeRelease 消息通知
     * @return 结果
     */
    @Override
    public int insertNoticeRelease(NoticeRelease noticeRelease) {
                noticeRelease.setCreateTime(DateUtils.getNowDate());
            return noticeReleaseMapper.insertNoticeRelease(noticeRelease);
    }

    /**
     * 修改消息通知
     *
     * @param noticeRelease 消息通知
     * @return 结果
     */
    @Override
    public int updateNoticeRelease(NoticeRelease noticeRelease) {
                noticeRelease.setUpdateTime(DateUtils.getNowDate());
        return noticeReleaseMapper.updateNoticeRelease(noticeRelease);
    }

    /**
     * 批量删除消息通知
     *
     * @param noticeIds 需要删除的消息通知主键
     * @return 结果
     */
    @Override
    public int deleteNoticeReleaseByNoticeIds(Long[] noticeIds) {
        return noticeReleaseMapper.deleteNoticeReleaseByNoticeIds(noticeIds);
    }

    /**
     * 删除消息通知信息
     *
     * @param noticeId 消息通知主键
     * @return 结果
     */
    @Override
    public int deleteNoticeReleaseByNoticeId(Long noticeId) {
        return noticeReleaseMapper.deleteNoticeReleaseByNoticeId(noticeId);
    }
}

